package com.gasstion.controller;

import com.gasstion.dao.TankDao;
import com.gasstion.dao.TankMainDao;
import com.gasstion.entity.Tank;
import com.gasstion.entity.TankMain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/tank")
@Scope("prototype")
public class TankController {
    @Autowired
    private TankDao tankDao;

    @RequestMapping("/queryAll")
    @ResponseBody
    public List<Tank> queryAll(){
        return tankDao.queryAll();
    }


    @RequestMapping("/weixiu")
    @ResponseBody
    public List<Tank> weixiu(int id,String detail){
        tankDao.weixiu(id,detail);
        return tankDao.queryAll();
    }

}
